package c.c.b.b.d;

import b.i.b.f;
import c.c.b.b.f.c;
import c.c.b.b.f.m;
import c.c.b.b.f.p;
import c.c.b.b.f.p.a;
import java.io.UnsupportedEncodingException;

/* compiled from: StringRequest */
public class q extends c<String> {
    private final Object c = new Object();
    private a<String> d;

    public q(int i, String str, a<String> aVar) {
        super(i, str, aVar);
        this.d = aVar;
    }

    public void a(p<String> pVar) {
        a aVar;
        synchronized (this.c) {
            aVar = this.d;
        }
        if (aVar != null) {
            aVar.a(pVar);
        }
    }

    public void cancel() {
        super.cancel();
        synchronized (this.c) {
            this.d = null;
        }
    }

    public p<String> a(m mVar) {
        Object str;
        try {
            str = new String(mVar.b, f.l(mVar.c, "UTF-8"));
        } catch (UnsupportedEncodingException unused) {
            str = new String(mVar.b);
        }
        return new p(str, f.f(mVar));
    }
}
